package com.wuhunyu.service;

import com.wuhunyu.commonutils.result.CommonResult;
import com.wuhunyu.entities.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wuhunyu.query.OrderQuery;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 订单 服务类
 * </p>
 *
 * @author wuhunyu
 * @since 2021-01-26
 */
public interface OrderService extends IService<Order> {

    /**
     * 创建订单信息
     * @param courseId
     * @param request
     * @return
     */
    public CommonResult createOrder(String courseId, HttpServletRequest request);

    /**
     * 获取订单信息
     * @param orderNo
     * @return
     */
    public CommonResult selectOrderInfo(String orderNo);

    /**
     * 查询订单支付状态
     * @param courseId
     * @param request
     * @return
     */
    public CommonResult selectOrderStatus(String courseId, HttpServletRequest request);

    /**
     * 查询订单支付状态，避免request，方便远程调用
     * @param courseId
     * @param memberId
     * @return
     */
    public CommonResult selectOrderStatus(String courseId, String memberId);

    /**
     * 查询订单信息
     * @param orderQuery
     * @return
     */
    public CommonResult selectCourseOrder(OrderQuery orderQuery);

}
